<!DOCTYPE html>
<html>
  <head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9"/>
	<title>jTopo Demo</title>
	<meta name="description" content="jTopo免费的基于HTML5 Canvas的网络拓扑、关系图形库">
	<meta name="keyword" content="jTopo 网络 拓扑 图形库 HTML5 Canvas 免费 关系图形库 javascript topology">	

	<link rel="stylesheet" type="text/css" href="../css/base.css">
	<link href="../css/jquery.snippet.min.css" rel="stylesheet">
	
	<script src="../js/jquery.js"></script>
	<script src="../js/site.js"></script>
	<script src="../js/demo.js"></script>
	
	<script type="text/javascript" src="js/snippet/jquery.snippet.min.js"></script>
	
	<script type="text/javascript" src="js/jtopo-min.js"></script>
	<script type="text/javascript" src="js/toolbar.js"></script>
	
	<script id='code'>
		$(document).ready(function(){
			var canvas = document.getElementById('canvas');			
			var g = canvas.getContext("2d");
			
			function painter(x, y, w, h){
				g.beginPath();
				g.moveTo(x, y+h);
				g.lineTo(x + w/2, y);
				g.lineTo(x + w, y + h);
				g.fill();
				g.closePath();
			}

			function bside(p1, p2){
				return function(x, y, w, h){
					p1(x, y, w/2, h);
					p2(x+w/2, y, w/2, h);
				};
			}

			function under(p1, p2){
				return function(x, y, w, h){
					p1(x, y, w, h/2);
					p2(x, y+h/2, w, h/2);
				};
			}
			
			var p = bside(painter, under(painter, bside(painter, painter)));
			
			function p2(painter, n){
				if(n == 0) return painter;
				var up = bside(painter, painter);
				return p2(under(up, painter), n-1);
			}
			
			var p = p2(painter, 3);
			p(100, 100, 400, 400);
		});
		
		
	</script>
  </head>

  <body>
	<center>
	<div class="wrap_div">
		<div class="head_nav">
			<h2 class="logo"><a href="index.html" title="jTopo">jTopo</a></h2>
		</div>		
		<div class="head_nav_second">			
			<ul class="menu" id="nav_menu">
			
			</ul>
		</div>
		<div class="content">
		  <div class="left">
			<ul id="menu">
			
			</ul>
		  </div>
		  <div class="right">
				<div id="content">					<canvas width="850" height="550" id="canvas"></canvas>	
									
				</div>
		  </div>
		  <div class="clear"></div>
		</div>
	</div>
	</center>
	<div class="footer">
		&nbsp;
	</div>

  
	<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1000418207'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "v1.cnzz.com/z_stat.php%3Fid%3D1000418207%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));</script>
</body>

</html>